import { http } from "../utils/request"
import type { PageParams, PageResult } from '@/types/global.d'
import type { BannerItem, CategoryItem, GuessItem, HotItem } from '@/types/home.d'
/**
 * 首页-广告区域-小程序
 * @param distributionSite 广告区域展示位置（投放位置 投放位置，1为首页，2为分类商品页） 默认是1
 */
export function getBannerAPI(distributionSite = 1){
	return http<BannerItem[]>({
		method:'GET',
		url: '/home/banner',
		data: {
			distributionSite,
		},
	})
} 

/**
 * 首页-前台分类-小程序
 */
export function getCategoryAPI(){
	return http<CategoryItem[]>({
		method: 'GET',
		url:'/home/category/mutli'
	})
}

/**
 * 首页-热门推荐-小程序
 */
export function getHotAPI(){
	return http<HotItem[]>({
		method: 'GET',
		url:'/home/hot/mutli'
	})
}

/**
 * 猜你喜欢-小程序
 */
export function getGoodsGuessLikeAPI(data?: PageParams){
	return http<PageResult<GuessItem>>({
		method: 'GET',
		url:'/home/goods/guessLike',
		data,
	})
}
